import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import '@fortawesome/fontawesome-free/css/all.min.css'
import axios from 'axios'
import './assets/css/global.css'
import Qs from 'querystringify'

Vue.prototype.$qs = Qs
// 设axios全局对象
Vue.prototype.$http = axios
// 请求主机
axios.defaults.baseURL = '/api/'
Vue.config.productionTip = false
axios.defaults.withCredentials=true

//请求拦截
axios.interceptors.request.use(
  config => {
    config.data = Qs.stringify(config.data)
    return config
  },
  err => {
    return Promise.reject(err)
  },
)

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
